//
//  UIView+Exienion.m
//  weibo-OC
//
//  Created by diyuyma on 16/3/24.
//  Copyright © 2016年 zhangkaiyun. All rights reserved.
//

#import "UIView+Exienion.h"

@implementation UIView (Exienion)

// 通过响应者链条 找到导航控制器
- (UINavigationController *)NavController {
    // 遍历响应者链条
    
    // 获取当前视图对象的下一个响应者
    UIResponder *next = self.nextResponder;
    do {
        if ([next isKindOfClass:[UINavigationController class]]) {
            return (UINavigationController *)next;
        }
        next = next.nextResponder;
    } while (next != nil);
    return nil;
}


@end
